# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=zita-jclient
pkgver=0.4.2
pkgrel=4
pkgdesc="Create a Jack client with a few lines of C++"
arch=(loong64 x86_64)
url="https://kokkinizita.linuxaudio.org/linuxaudio/downloads/index.html"
license=(GPL3)
depends=(
  gcc-libs
  glibc
)
makedepends=(jack)
provides=(libzita-jclient.so)
source=("https://kokkinizita.linuxaudio.org/linuxaudio/downloads/$pkgname-$pkgver.tar.bz2")
sha512sums=('c785e4fe01561dde7fb6bca985de0c5735fdad1666f6c37ff2a783360b5c6fbe30837088715fe20e21c81cd9396e237fca25c91e8bd18d401032a8ca6a8f06e5')
b2sums=('03ccefa3ade3567c62148fb66527117b4c31f3e664d02cb49b6ecba33825bd1ced64351b4b03cf25f8ad829cf2b1b3bd2fceb47f87e5832e2c0aecc2baae46cf')

prepare() {
  # remove optimization
  # call ldconfig in local context
  sed -e '/march=native/d; s/ldconfig/& -N $(DESTDIR)\/$(LIBDIR)/' -i $pkgname-$pkgver/source/Makefile
}

build() {
  make -C $pkgname-$pkgver/source
}

package() {
  depends+=(
    jack libjack.so
  )

  make DESTDIR="$pkgdir/" PREFIX=/usr SUFFIX="" install -C $pkgname-$pkgver/source
  install -vDm 644 $pkgname-$pkgver/{AUTHORS,README} -t "$pkgdir/usr/share/doc/$pkgname/"
}
